import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader
from torch.utils.data import DataLoader, TensorDataset



x=torch.randn(5,10,2)
y=torch.randn(5,1)


d_ = TensorDataset(x,y)
for _ in d_:
    print(_)
    # break
    '''
    (tensor([ 2.2553, -0.5432]), tensor([-1.3520]))
    (tensor([-2.5055,  1.7971]), tensor([-0.5991]))
    (tensor([ 0.5660, -0.0011]), tensor([0.2263])) 
    (tensor([0.9341, 1.4885]), tensor([1.6507]))   
    (tensor([0.4843, 1.8224]), tensor([0.2442]))   
    (tensor([-0.6362,  2.0576]), tensor([-2.1450]))
    (tensor([-1.0829, -0.8644]), tensor([-0.0097]))
    (tensor([-0.8987, -0.4430]), tensor([-0.3217]))
    (tensor([-1.2135,  2.3631]), tensor([-0.8889]))
    (tensor([0.3280, 1.3414]), tensor([1.2588]))  
    
    '''
print('dataloader------')
dataloader = DataLoader(d_,shuffle=True,batch_size=3)
for _ in dataloader:
    print(_)
    break
    '''
    [tensor([[-0.9624, -0.9776],
            [-1.0235,  0.5000],
            [-1.3115,  1.1484]]), 
            
            tensor([[ 0.5165],
            [-0.3857],
            [-0.8781]])]

    '''

